package acm.pacific2007.northwest;

import java.util.Scanner;

/*
 * p3059
 */

public class p3059 {

	static int nTest, n, c1, c2;
	static String s1, s2;

	public static void main(String[] args) {
		
		Scanner scanner = new Scanner(System.in);
		nTest = scanner.nextInt();
		for (int i=1;i<=nTest;++i) {
			n = scanner.nextInt();
			c1 = c2 = 0;
			for (int j=1;j<=n;++j) {
				s1 = scanner.next();
				s2 = scanner.next();
				compare();
			}
			if (c1 == c2) {
				System.out.println("TIE");
			}
			else if (c1 > c2) {
				System.out.println("Player 1");
			}
			else {
				System.out.println("Player 2");
			}
		}

	}

	private static void compare() {

		if (s1.startsWith("R")) {
			if (s2.startsWith("S")) {
				++c1;
			}
			else if (s2.startsWith("P")) {
				++c2;
			}
		}
		else if (s1.startsWith("P")) {
			if (s2.startsWith("S")) {
				++c2;
			}
			else if (s2.startsWith("R")) {
				++c1;
			}
		}
		else { // scissors
			if (s2.startsWith("P")) {
				++c1;
			}
			else if (s2.startsWith("R")) {
				++c2;
			}
		}
	}

}
